<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //console.log(1);
    for (let i = 1; i < 10; i++) {
        console.log(1);  
    }
    //1.计算1~100之间的和
    for(i=1;i<=100;i++){
        sum+=i;
    }
    console.log(+ sum);
    console.log('----------');
    //while循环和do...while循环
    let i=0;
    while(i<100){
    if(i%2==0){
        console.log(i);//0 2
        }
    i++;//1 2 3
    }
    console.log('-----------');
    let a = 10;
    while(a<10){
        console.log('执行while循环');
    }
    let b =10;
    do{
        console.log('执行do.....while循环');
    }while(b<10)
    //打印4行5列的*
    let str='';
    for(let i = 0; i<4;i++){
        //str ='';
        for (let j = 0; j < 5; j++) {
         str+='*';
        }
        console.log(str+'\n')
    }
</script>
</html>